<?php if (!defined('THINK_PATH')) exit();?><h2 class="contentTitle">表单验证</h2>


<div class="pageContent">
	
	<form method="post" action="<?php echo U('Listinfo/editAction');?>?callbackType=closeCurrent" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone)">
		<div class="pageFormContent nowrap" layoutH="97">

			<dl>
				<dt>用户名：</dt>
				<dd>
					<input type="text" name="title" maxlength="20" class="required" value="<?php echo ($result["title"]); ?>"/>
					<span class="info">用户名</span>
				</dd>
			</dl>
			<dl>
				<dt>内容：</dt>
				<dd>
					<input type="text" name="content" maxlength="20" class="required" value="<?php echo ($result["content"]); ?>"/>
					<span class="info">内容</span>
				</dd>
			</dl>
			<dl>
				<dt>推荐类型：</dt>
				<dd>
					<?php if(is_array($recommend)): foreach($recommend as $k=>$vo): ?><!-- 注意下面的name和value值的书写 -->
						<?php if(in_array(($vo["id"]), is_array($result["recommend_id"])?$result["recommend_id"]:explode(',',$result["recommend_id"]))): ?><input  checked="checked" type="checkbox" name="choose[]" id="" value="<?php echo ($vo["id"]); ?>"/><?php echo ($vo["name"]); ?>
						<?php else: ?>
							<input type="checkbox" name="choose[]" id="" value="<?php echo ($vo["id"]); ?>"/><?php echo ($vo["name"]); endif; endforeach; endif; ?>
				</dd>
			</dl>
			<dl>
				<dt>商品链接：</dt>
				<dd>
					<input type="text" name="url" maxlength="20" class="required" value="<?php echo ($result["url"]); ?>"/>
					<span class="info">商品链接</span>
					<input type="hidden" name="id" value="<?php echo ($result["id"]); ?>"/>
				</dd>
			</dl>
			
			<!-- <dl>
				<dt>密码：</dt>
				<dd>
					<input type="text" name="pass" maxlength="20" class="required" value="<?php echo ($result["pass"]); ?>"/>
					<span class="info">密码</span>
					<input type="hidden" name="id" value="<?php echo ($info["id"]); ?>"/>
				</dd>
			</dl> -->
			
		</div>
		<div class="formBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">提交</button></div></div></li>
				<li><div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div></li>
			</ul>
		</div>
	</form>
	
</div>


<script type="text/javascript">
function customvalidXxx(element){
	if ($(element).val() == "xxx") return false;
	return true;
}
</script>